/* 变量定义 */
:root {
    /* 颜色 */
    --primary-color: #1a73e8;
    --secondary-color: #8b5cf6;
    --text-primary: #2c3e50;
    --text-secondary: #666;
    --bg-light: #fff;
    --bg-dark: #1a1c1e;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* 动画 */
    --transition-base: all 0.3s ease;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    background-image: 
        /* url(../img/avatar.jpg), */
        radial-gradient(circle at 50% -20%, rgba(26, 115, 232, 0.15) 0%, transparent 70%),
        linear-gradient(45deg, 
            rgba(99, 102, 241, 0.08) 0%,
            rgba(26, 115, 232, 0.08) 25%,
            rgba(147, 51, 234, 0.08) 50%,
            rgba(26, 115, 232, 0.08) 75%,
            rgba(99, 102, 241, 0.08) 100%
        ),
        radial-gradient(circle at 25px 25px, rgba(99, 102, 241, 0.15) 2%, transparent 2.5%),
        radial-gradient(circle at 75px 75px, rgba(26, 115, 232, 0.15) 2%, transparent 2.5%);
    background-size: 100% 100%, 200% 200%, 100px 100px, 100px 100px;
    background-position: 0 0, 0 0, 0 0, 50px 50px;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}


/* 头部 */
.header {
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
    font-size: 2.2em;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* 导航菜单 */
.nav-menu ul {
    display: flex;
    justify-content: center;
    gap: 30px;
    list-style: none;
    padding: 0;
}

.nav-menu a {
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition-base);
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: rgba(26, 115, 232, 0.1);
    transform: translateY(-2px);
}

.nav-menu a:hover::after {
    width: 70%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .nav-menu ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .post {
        padding: 20px;
    }

    .post h2 {
        font-size: 1.5em;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .floating-buttons {
        right: 15px;
        bottom: 15px;
    }

    .floating-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
    color: var(--text-secondary);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--primary-color),
        var(--secondary-color),
        transparent
    );
}


/* 暗色模式 */
[data-theme="dark"] {
    --text-primary: #e4e7eb;
    --text-secondary: #a0aec0;
    --bg-light: rgba(30, 34, 39, 0.95);
    
    body {
        background: linear-gradient(135deg, var(--bg-dark) 0%, #2c3e50 100%);
        background-image:
            radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.2) 0%, transparent 70%),
            linear-gradient(45deg, 
                rgba(147, 51, 234, 0.15) 0%,
                rgba(99, 102, 241, 0.15) 50%,
                rgba(147, 51, 234, 0.15) 100%
            );
    }
    
    .header,
    .articles-section,
    .sidebar,
    .floating-button {
        background: var(--bg-light);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--secondary-color), var(--primary-color));
}


/* 滚动进度条 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right,
        var(--primary-color),
        var(--secondary-color)
    );
    transform-origin: 0 50%;
    transform: scaleX(0);
    transition: transform 0.1s ease;
    z-index: 1000;
}

/* 自定义选择文本样式 */
::selection {
    background: rgba(26, 115, 232, 0.2);
    color: var(--primary-color);
}

/* 打印样式优化 */
@media print {
    body {
        background: none;
        color: #000;
    }
  
    .header,
    .sidebar,
    .floating-buttons,
    .footer {
        display: none;
    }
  
    .main-content {
        display: block;
    }
  
    .post {
        break-inside: avoid;
        page-break-inside: avoid;
        border: none;
        box-shadow: none;
    }
  }
  
  /* 高对比度模式适配 */
  @media (prefers-contrast: high) {
    :root {
        --primary-color: #0052cc;
        --secondary-color: #6200ee;
    }
  
    .post,
    .category-item,
    .tag {
        border: 2px solid currentColor;
    }
  }
  
  /* 减少动画模式适配 */
  @media (prefers-reduced-motion: reduce) {
      * {
          animation-duration: 0.01ms !important;
          animation-iteration-count: 1 !important;
          transition-duration: 0.01ms !important;
          scroll-behavior: auto !important;
      }
  }